package com.gitee.wsl.security.password

import com.gitee.wsl.security.encrypt.Encrypt
import com.gitee.wsl.security.encrypt.StringToStringEncrypt
import com.gitee.wsl.security.encrypt.password
import com.gitee.wsl.struct.generator.StringGeneratorWithLength

object Password{
    fun matches(password: String, encodedPassword: String,match: PasswordMatch): Boolean = match.matches(password, encodedPassword)

    fun generate(length:Int, generator: StringGeneratorWithLength) = generator(length)

    fun encode(password: String,encoder: StringToStringEncrypt = Encrypt.password) = encoder.encrypt(password)

}